home *** CD-ROM | disk | FTP | other *** search
/ Holt Researcher: American History / Holt Researcher: American History.iso / pc / modules / dbtext.dxr / 00003_Max Min Layout Screen.ls < prev    next >
Encoding:
Text File  |  2000-01-18  |  3.2 KB  |  95 lines

  1. global gDBTextVarList
  2.  
  3. on ResizeLayOutScreen
  4.   if the width of sprite 1 = 640 then
  5.     size = 1
  6.   else
  7.     size = 2
  8.   end if
  9.   SizeWindowArt(size)
  10.   EnableScroll = SizeText(size)
  11.   SizeScroll(size)
  12.   EvalDisableScroll(EnableScroll)
  13.   SizeMIAW(size)
  14.   updateStage()
  15.   SetScrollHandler()
  16. end
  17.  
  18. on SizeWindowArt size
  19.   MyObj = getaProp(gDBTextVarList, GetObjProp())
  20.   SetPuppetState([1, 3], #c, 1)
  21.   BorderRect = GetBorderRect(MyObj, size)
  22.   set the rect of sprite 1 to BorderRect
  23.   set the rect of sprite 2 to BorderRect + rect(1, 1, -1, -1)
  24.   xMemberNum = the number of member getAt(["doc min", "doc max"], size)
  25.   set the member of sprite 3 to member(xMemberNum)
  26.   set the rect of sprite 3 to rect(0, 0, member(xMemberNum).width, member(xMemberNum).height)
  27.   SpriteList = GetSpriteList(MyObj)
  28.   ButtonList = GetButtonList(MyObj)
  29.   repeat with rc in ButtonList
  30.     buttonLoc(rc, size)
  31.   end repeat
  32. end
  33.  
  34. on SizeText size
  35.   MyObj = getaProp(gDBTextVarList, GetObjProp())
  36.   EnableScroll = 0
  37.   SpriteList = GetSpriteList(MyObj)
  38.   TextSprite = getaProp(SpriteList, #text)
  39.   xMember = the member of sprite TextSprite
  40.   xRect = GetTextRect(MyObj, size)
  41.   member(xMember).rect = xRect
  42.   if member(xMember).height > (GetRectHeight(xRect) + 7) then
  43.     EnableScroll = 1
  44.   end if
  45.   set the loc of sprite TextSprite to point(getAt(xRect, 1), getAt(xRect, 2))
  46.   member(xMember).scrollTop = 0
  47.   ResetSelections(MyObj)
  48.   return EnableScroll
  49. end
  50.  
  51. on SizeScroll size
  52.   MyObj = getaProp(gDBTextVarList, GetObjProp())
  53.   SpriteList = GetSpriteList(MyObj)
  54.   TextSprite = getaProp(SpriteList, #text)
  55.   xMember = the member of sprite TextSprite
  56.   OutSideRect = GetBorderRect(MyObj, size) + rect(0, 0, -2, -1)
  57.   InnerRect = GetInsideRect(2, OutSideRect)
  58.   TextRect = GetTextRect(MyObj, size)
  59.   NArrowSp = getaProp(SpriteList, #NArrow)
  60.   SArrowSp = getaProp(SpriteList, #SArrow)
  61.   ThumbSp = getaProp(SpriteList, #VThumb)
  62.   sL = getAt(InnerRect, 3) - the width of sprite NArrowSp
  63.   sT = getAt(TextRect, 2)
  64.   sR = getAt(InnerRect, 3)
  65.   sB = getAt(InnerRect, 4)
  66.   set the rect of sprite getaProp(SpriteList, #VBed) to rect(sL, sT, sR, sB)
  67.   set the rect of sprite NArrowSp to rect(sL, sT, sR, sT + the height of sprite NArrowSp)
  68.   set the rect of sprite SArrowSp to rect(sL, sB - the height of sprite SArrowSp, sR, sB)
  69.   thumbTop = sT + the height of sprite NArrowSp
  70.   set the rect of sprite ThumbSp to rect(sL, thumbTop, sR, thumbTop + (the member of sprite ThumbSp).height)
  71.   ThumbXLoc = (sR - sL) / 2
  72.   ThumbMin = thumbTop + ((the member of sprite ThumbSp).height / 2)
  73.   ThumbMax = sB - the height of sprite SArrowSp - (the height of sprite ThumbSp / 2)
  74.   numLines = member(xMember).lineCount
  75.   numVisLines = GetRectHeight(TextRect) / the textHeight of member xMember
  76.   numSettings = numLines - numVisLines + 1
  77.   ResizeScroll(MyObj, ThumbXLoc, ThumbMin, ThumbMax, 1, numSettings, 1, numSettings)
  78. end
  79.  
  80. on SizeMIAW size
  81.   if count(the windowList) > 0 then
  82.     MyObj = getaProp(gDBTextVarList, GetObjProp())
  83.     windowName = (the activeWindow).name
  84.     MyRect = window(windowName).rect
  85.     if size = 1 then
  86.       l = getAt(MyRect, 1)
  87.       t = getAt(MyRect, 2)
  88.     else
  89.       l = getAt((the stage).rect, 1)
  90.       t = getAt((the stage).rect, 2) + 26
  91.     end if
  92.     window(windowName).rect = GetBorderRect(MyObj, size) + rect(l, t, l, t)
  93.   end if
  94. end
  95.